import { Picker } from "antd-mobile/2x";

export const PickerView = (props: any) => {
  const { visible, setVisible, data, onChangeData } = props;
  return (
    <div>
      <Picker
        columns={[data.data]}
        visible={visible}
        onClose={() => {
          setVisible(false);
        }}
        onConfirm={(v) => {
          onChangeData(data.name, v[0]);
        }}
      />
    </div>
  );
};

export default PickerView;
